﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TN_CMS.Domain.Entities;

namespace TN_CMS.Domain.Abstract
{
    public interface INewsGroupRepository
    {
        IQueryable<NewsGroup> NewsGroups { get; }

        /// <summary>
        /// Get NewsGroup by page
        /// </summary>
        /// <param name="page">page index</param>
        /// <param name="pageSize">Page size</param>
        /// <returns></returns>
        IQueryable<NewsGroup> GetList(out int total, int page = 0, int pageSize = 10, bool getInactive = true);

        /// <summary>
        /// Get NewsGroup by page
        /// </summary>
        /// <param name="pageIndex">page index</param>
        /// <param name="pageSize">Page size</param>
        /// <param name="total">Total page</param>
        /// <param name="orderClause">Order clause</param>
        /// <param name="pageSize">Where clause</param>
        /// <returns></returns>
        List<NewsGroup> GetList(int pageIndex, int pageSize, out int total, string orderClause, string whereClause);

        /// <summary>
        /// Get NewsGroup by NewsGroupId
        /// </summary>
        /// <param name="id">NewsGroupId</param>
        /// <returns></returns>
        NewsGroup GetDetail(int id, bool getInactive = true);

        /// <summary>
        /// Save NewsGroup when update or create new NewsGroup
        /// </summary>
        /// <param name="newsGroup">NewsGroup entity</param>
        /// <param name="actorId">adminId, who save this NewsGroup</param>
        /// <returns></returns>
        void Save(NewsGroup newsGroup, int actorId);

        /// <summary>
        /// Delete NewsGroup(s)
        /// </summary>
        /// <param name="ids">NewsGroup Id(s)</param>
        /// <returns></returns>
        void Delete(int[] ids);

        /// <summary>
        /// Deactive NewsGroup(s)
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="isActive">Active status</param>
        void UpdateActive(int[] ids, bool isActive);
    }
}
